Many devices such as musical instruments, calculators, and electronic typewriters receive input information through keyboards. Keyboard systems in such devices sense the depression or other actuation of keys in various ways. One way, which is often employed in electronic typewriter and personal computer keyboards, is the use of a key switch matrix, as illustrated diagrammatically in FIG. 1.
In the illustrated example, conductors 11-17 serve as drive lines, and conductors 18-22 serve as sense lines. The drive lines and sense lines are electrically isolated from one another but can be coupled together by the actuation (closure) of key switches such as 23 and 25 located at the crossover locations of the drive and sense lines. Such switches are shown somewhat less diagrammatically in FIG. 2.
Returning to FIG. 1, each of the drive lines 11-17 is strobed with a drive signal in sequence, and the sense lines 18-22 are sensed for the coupling of the drive signal through an actuated switch such as the switch 25. For example, if a drive signal is applied to the drive line 16, and the key switch 25 is closed, the drive signal is coupled to the sense line 21. Based upon the drive line which is driven and the sense line receiving the drive signal, a precise determination is made of the identity of the actuated key switch.
Certain problems arise in matrix keyboards such as that of FIG. 1 when multiple switches are closed simultaneously. One such problem occurs when certain combinations of three or more switches are simultaneously actuated. In that case, it may appear (erroneously) that additional (unclosed) switches are also actuated. For example, if certain configurations of three switches are actuated, it appears that four switches are actuated, and it is impossible to determine which of the detected actuations is falsely indicated.
This is referred to as a phantom, or ghost, key condition. To illustrate, in FIG. 1 assume that key switches 24, 26 and 27 are closed. When a drive signal is applied to the drive line 12, the signal is coupled through the switch 24 to the sense line 19 and through the switch 26 to the sense line 20. This provides an indication that key switches 24 and 26 are closed. When the drive line 14 is driven, the drive signal is coupled through the switch 27 to the sense line 19, indicating that the key switch 27 is closed. However, when the drive line 14 is driven, the drive signal is also coupled through the switch 27, the sense line 19, and the switch 24 to the drive line 12. From there the drive signal is coupled through the switch 26 to the sense line 20. Therefore, it appears that the switch 28 is closed and being driven by the drive line 14 while, in reality, the switch 28 is open. It has been noted in arrays such as that of FIG. 1 that if there are three switches actuated at the corners of a notional rectangle within the array, the switch at the fourth corner of the rectangle appears to be actuated.
In the past, one way that ghost key conditions have been prevented is by supplying diodes for each of the key switches to prevent the reverse coupling of a drive signal from a sense line onto another (undriven) drive line. Another type of matrix keyboard uses scaling elements such as resistors along each line between each of the crossover points so that a spurious drive signal is attenuated and recognized as false on the sense line where it is detected. The cost of such approaches includes the costs of procurement, installation and testing of all of the additional components which must be placed in the matrix.
Alternatively, in order to avoid the expense of additional components and to use simple key switch matrices such as that of FIG. 1, control schemes have been implemented to look for situations where multiple keys are actuated and to disregard the key switch actuation indications which are sensed. For example, with reference again to FIG. 1, in one such approach the results of applying a drive signal to each of the drive lines 11-17 in sequence are stored in a memory device or register. An algorithm is then applied to the results, and the results are disregarded if the ghost key definition of the algorithm is met.
For example, it may be decided that if two switches such as 24 and 27 are actuated on a single sense line 19 (as determined based upon storing the results from driving the drive line 12 and from driving the drive line 14), all sensed key switches from that drive line scan sequence are to be disregarded. A more restrictive algorithm might call for disregarding a set of key switch indications only where, for example, not only switches 24 and 27 were actuated but also another switch on another sense line. The ghost key detection algorithm could call for disregarding key switch actuation indications in various other defined situations.
Generally, in these prior techniques for detecting a ghost key condition, there is a delay associated with processing the results of a sequence of drive line activations before reaching a conclusion as to the presence or absence of a ghost key condition. Further, many of the prior algorithms employed in ghost key detection result in disregarding multiple keystrokes in situations where a ghost key condition does not truly exist.